package com.esri.core.tasks.geocode;

import com.esri.core.geometry.GeometryEngine;
import com.esri.core.geometry.Point;
import com.esri.core.geometry.SpatialReference;
import com.esri.core.internal.tasks.a.d;
import java.util.LinkedHashMap;

/* loaded from: classes.dex */
public class LocatorSuggestionParameters {
    private static final double DEFAULT_DISTANCE = 2000.0d;
    private static final String DISTANCE_KEY = "distance";
    private static final String LOCATION_KEY = "location";
    private static final String TEXT_KEY = "text";
    private Double mDistance = null;
    private Point mLocation;
    private SpatialReference mSpatialReference;
    private String mText;

    public LocatorSuggestionParameters(String str) {
        this.mText = str;
    }

    public void setText(String str) {
        this.mText = str;
    }

    public String getText() {
        return this.mText;
    }

    public Point getLocation() {
        return this.mLocation;
    }

    public void setLocation(Point point, SpatialReference spatialReference) {
        this.mLocation = point;
        this.mSpatialReference = spatialReference;
    }

    public void setDistance(double d) {
        this.mDistance = Double.valueOf(d);
    }

    public double getDistance() {
        Double d = this.mDistance;
        return d == null ? DEFAULT_DISTANCE : d.doubleValue();
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public d getInternalParameters() {
        d dVar = new d();
        dVar.a = new LinkedHashMap();
        if (this.mText != null) {
            dVar.a.put(TEXT_KEY, this.mText);
        }
        if (this.mLocation != null) {
            dVar.a.put(LOCATION_KEY, GeometryEngine.geometryToJson(this.mSpatialReference, this.mLocation));
            if (this.mDistance != null) {
                dVar.a.put(DISTANCE_KEY, String.valueOf(this.mDistance));
            }
        }
        return dVar;
    }
}
